import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    component: resolve => require(["../views/home/Home.vue"], resolve)
  },
  {
    path: "/articles/:articleId",
    component: resolve => require(["../views/article/Article.vue"], resolve)
  },
  {
    path: "/archives",
    component: resolve => require(["../views/archive/Archive.vue"], resolve),
    meta: {
      title: "归档"
    }
  },
  /*
{
  path: "/albums",
  component: resolve => require(["../views/album/Album.vue"], resolve),
  meta: {
    title: "相册"
  }
},
{
  path: "/talks",
  component: resolve => require(["../views/talk/Talk.vue"], resolve),
  meta: {
    title: "说说"
  }
},
{
  path: "/talks/:talkId",
  component: resolve => require(["../views/talk/TalkInfo.vue"], resolve),
  meta: {
    title: "说说"
  }
},*/
  {
    path: "/courses",
    component: resolve => require(["../views/course/Course.vue"], resolve),
    meta: {
      title: "课程"
    }
  },{
    path: "/courses/:courseId",
    component: resolve => require(["../views/course/Player.vue"], resolve),
    meta: {
      title: "课程播放"
    }
  },
  {
    path: "/school",
    component: resolve => require(["../views/school/index.vue"], resolve),
    meta: {
      title: "院校"
    }
  },{
    path: "/school/:schoolId",
    component: resolve => require(["../views/school/Details.vue"], resolve),
    meta: {
      title: "院校详情"
    }
  },
  {
    path: "/tags",
    component: resolve => require(["../views/tag/Tag.vue"], resolve),
    meta: {
      title: "标签"
    }
  },
  {
    path: "/categories",
    component: resolve => require(["../views/category/Category.vue"], resolve),
    meta: {
      title: "分类"
    }
  },
  {
    path: "/categories/:categoryId",
    component: resolve => require(["../views/article/ArticleList.vue"], resolve)
  },
  {
    path: "/tags/:tagId",
    component: resolve => require(["../views/article/ArticleList.vue"], resolve)
  },
  /*{
    path: "/games",
    component: resolve => require(["../views/games/Games.vue"], resolve),
    meta: {
      title: "小游戏"
    }
  },
  {
    path: "/albums/:albumId",
    component: resolve => require(["../views/album/Photo.vue"], resolve)
  },
  {
    path: "/about",
    component: resolve => require(["../views/about/About.vue"], resolve),
    meta: {
      title: "关于我"
    }
  },
  */
  {
    path: "/links",
    component: resolve => require(["../views/link/Link.vue"], resolve),
    meta: {
      title: "社区"
    }
  },
  {
    path: "/message",
    component: resolve => require(["../views/message/Message.vue"], resolve),
    meta: {
      title: "留言板"
    }
  },
  {
    path: "/user",
    component: resolve => require(["../views/user/User.vue"], resolve),
    meta: {
      title: "个人中心"
    }
  },
  {
    path: "/oauth/login/qq",
    component: resolve => require(["../components/OauthLogin.vue"], resolve)
  },
  {
    path: "/oauth/login/weibo",
    component: resolve => require(["../components/OauthLogin.vue"], resolve)
  }
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes
});

export default router;
